<%--
  Created by IntelliJ IDEA.
  User: xiaoji
  Date: 2014/11/24
  Time: 14:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="session"/>
<!DOCTYPE html>

<html>
<head>
    <title>评价信息管理</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/icon.css">
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function(){
            //查询
            $("#search").click(function(){
                var currenttab =  $("#search").attr("stab");
                $('#'+currenttab).datagrid('load',{
                    contract_id:$("#contract").val(),
                    by_appraiser:$("#by_appraiser").val(),
                    appraiser:$("#appraiser").val()
                });
            });

        });


    </script>
</head>
<body class="easyui-layout">
<div region="center" style="padding:5px;" border="false">
        <%--<div title="评价信息管理" style="padding:10px;height: 650px;">--%>
            <!--列表-->
            <table id="ttAll" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:'${path}/appraise/view.do',rownumbers: true,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'contract_id',align:'center',width:80">合同编号</th>
                    <th data-options="field:'total_appraise',align:'center',width:80">整体评价</th>
                    <%--<th data-options="field:'service_attitude',align:'center',width:80">交流能力</th>--%>
                    <%--<th data-options="field:'work_speed',align:'center',width:80">回应速度</th>--%>
                    <%--<th data-options="field:'finish_quality',align:'center',width:80">作品质量</th>--%>
                    <%--<th data-options="field:'effect_tag',align:'center',width:80">印象标签</th>--%>
                    <th data-options="field:'content',align:'center',width:200">评价内容</th>
                    <th data-options="field:'appraiser',align:'center',width:80">评价方</th>
                    <th data-options="field:'by_appraiser',align:'center',width:80">被评价方</th>
                    <th data-options="field:'appraise_time',align:'center',width:180">评价时间</th>
                    <th data-options="field:'flag',align:'center',width:80,formatter:function(v){if(v == 101001) return '有效'; else return '无效';}">状态</th>

                    <th data-options="field:'appraise_id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        <%--</div>--%>


</div>
<!--头工具项-->
<div id="tb" style="padding:2px 5px;">
    合同编号: <input class="easyui-textbox" name="contract" id="contract" style="width:110px">
    评价方账号: <input class="easyui-textbox" name="contract" id="appraiser" style="width:110px">
    被评方账号: <input class="easyui-textbox" name="contract" id="by_appraiser" style="width:110px">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="search" stab="ttAll">查找</a>
</div>

<script>
    function rowformatter(value,row,index){

        if(row.flag == 101001){
            return '<a href="#" onclick="f_deleteAppraise(this,'+value+')">删除</a>';
        }

    }

    function f_deleteAppraise(obj,value){
        //alert(value);
        //$(obj).parent().html("");

        $.post("${path}/appraise/deleteAppraise.do", { appraiseId: value},
                function(data, textStatus){

                    if(data == "success"){

                        $('#ttAll').datagrid('reload');

                    }else{

                        alert("删除失败！请检查信息！");
                    }

                });


    }
</script>
</body>
</html>
